var vueApp = new Vue({
  el: '#app',
  data: function () {
    return {
    	  importId:'',
    	  tableId: '',
    	  impstatus:'',
    	  stsOptions:[],
    	  ths:[],
    	  impData:[],
    	  currentPageNbr: config.currentPageNbr,
          pageSizes: config.pageSizes,
          pageSize: config.defaultpageSize,
          totalRecords: 0,
      };
  },
  mounted: function () {
    this.initData();

  },
  methods: {
    initData:function(){
       this.importId = tools.getQueryString("importId");
       this.tableId = tools.getQueryString("tableId");
       this.impstatus = tools.getQueryString("impStatus");
       this.stsOptions = import_status;
       this.onSearch();       
    },
    onSearch:function(){
      var that = this;
      var jso = {
    	 "importId": this.importId,
    	 "tableId": this.tableId
     };
      var postdata = {
    	  "jsonStr":JSON.stringify(jso),    		 
    	  "currentPageNbr" : this.currentPageNbr,
    	  "pageSize" : this.pageSize
      };
      tools.ajaxRequestAsyncEx("pub/import/detail",postdata, function(data){
          if (data.respCode == "0") {
        	  that.ths = data.header;
        	  that.impData = data.list;
        	  that.totalRecords = data.page.totalRecords; 
          } else {
        	  that.ths = [];
              that.impData = [];
              that.totalRecords =0;
              that.currentPageNbr=1;
              that.showError(data.respDesc);      
          }
      });

    },
   
    handleSizeChange:function(pageSize){
        this.pageSize = pageSize;
        this.currentPageNbr = 1;
        this.onSearch();
    },

    handleCurrentChange:function(currentPageNbr){
      this.currentPageNbr = currentPageNbr;
      this.onSearch();
    },
    
    showError: function(info){
        var i = (info==undefined?"加载数据错误":info);
        this.$alert(i, '系统错误', {
             confirmButtonText: '确定'
        }); 
    },
  },
  watch:{
	  
  }
})